cleaning and fixing bugs