bug fix for exception