Implemented single-instance checking.