fixed pointer/reference issue