prevent external input to cause exceptions