Validates input type, sends error if incorrect