bugs fixed

fixed some main bugs