added a cake validation snippet.