adding alert for invalid word