fix bug in error