fixed many little bugs