Fixed Issues and added patter unitOfWork