Fixed issue when trying to dismiss viewcontroller before it was being presented.
Merge pull request #5 from nixonnixon/master

Fixed issue when trying to dismiss viewcontroller before it was being presented