catch strange invalid pointer error