Resolved error with the new free function