fixed bugs, added case for enter