Added script library to prevent multiple instances [fixed tracker #1625]