adding a small error check when running the executable