Added bail function