fixing bugs in startup script--currently broken