updated remove custom data field method to behave like in Java