check that methods exist before calling them

it's possible that some things aren't configured in exceptional states
Merge pull request #6 from minrk/check-res.writeH

check that methods exist before calling them