fix auto type casting on rel fields