fixed all functionality