fixed $apply usage