fixed bugs finally