Code breaking bug fix