fix env vars and startup script