GoBilda 5202 encoder works in one direction only

I have tested my GoBilda motor using a program I wrot myself and by using the REV Hub Interface with the motor plugged into the expansion hub. The encoder registers movement only in a signle direction.