bug fix for performance enhancement