The bug that are caused by using resource is fixed