fix bug, should return on error