fix possible bugs in the start script wrapper