fix bugs on Ubuntu 10.04 $ 12.04