added a check for a valid day name