prevent event if fields not filled