fixed bugs & cleaning