remove that object to array function