Prevent callbacks from being executed multiple times

I added some additional checks to prevent callbacks from being executed
more than once if several scripts are running.