fixed bug with cake logic