Add checks on inputs