fix reflection function