bugg fix and cleaning