change return type, fix a bug