fixed minor bugs and added error messages/empty messages