included flagField-check and fixed a bug in visual.c