Added improved csrf protection