fix bug, make code works with ghc 7.6.3