Fixed bug in key sequence