shouldn't you pass $val here (which is the Property object i think?) then you would not need to get it again