Removed potentially buggy safe apply code