Added check if script is running with elevated rights