Getting the startup script to run correctly