fix nil error in ensure block

 which hides exceptions