fix bug with error