fixed bugs, but controller is not working as intended