Implemented lock feature that allows to restrict running multiple sessions of one script.