showing errors when needed