cast obj to array