add error function in default controller