Fix val dereference issue