pretty messy, need to get update working with JPA