some bugs engine and chenges fixed