fixed error on empty fields