added guard to gem, added flash added error message to form input