fix a bug in create_startup_args and some cleanup
cleaning up