Listen for keyup instead of keydown before updating the output