Added a try and except block around get keypair call for catching errors...

... on AWS