fixed to work with ghc 7.6