fixed last second bugs