bug fix on pointers