fixed bug, tho it is tentative