Changes to make cakephp 3 compatible