Check exit code instead of eval