add error handling for program not to stop on an error