fix for returing undefined instead of empty object