create function removeErrorMessage

remove error messages for duplicate and for empty input when the user is
typing in the input