Ported to new version of hails