script updated and bugs fixed