Moved completion code into else block