bug fix for 5797