fixed bug on caching and pathway workaround

isset($data['pathway']) returns true even when $data is not an array...
This happens for PHP versions lower than 5.4.x