[BUGFIX] properly check for array keys