Fixed checking input