old code bug removed