fixed bug due to unused variable