This check will always be "true" since you're passing an array all the time. Maybe you should check entries.length.