scripts updated and bugs prevention