corrected some bugs
more bugs fixed