Fixing minor bug by using messageboxes