forgotten error function added