valid expression checking