added input validation to source.cpp