fixed all found bugs