Fixed a bug in closing prompt

Now it works