added unit test for dereference patch