updated for cake > 2.3