updated code for cakephp 2.4.1