added JPA and fixed collections