updated for hibernate