fixed issues with script