prePersist function call
fixed some unit tests