fix bug thanks to skdear