Better debounce function + Solve minor things