input checking fixed