Updated code to remove non-thread safe use of JCR Session