confusion with last key printed twice