fixed bugs related to JPA