Fixing strange bug