fix formula input validation