fixed bug found by using framework