fixed "empty array"-bug