fixed sever bugs