updated to compile with ghc 7.8