fixed bug dependent code