memory leaks fixed. sci -> safe_check_input