fixed movement and some seg fault causes