adds input error status and makes focusout more robust