tried to fix bugs