Added an event handler, now the snake is under control