updated returns() to return correct object if passed empty array or object