Modified model validation example, now it runs in browser too.