Fixed double pressing error. Refactoring