add input check source code fix