failsafe for empty array