Checks input