Added mutex for locking and unlocking
Added quit