null to array bug-fix