add input check source code