fixed previously bad regex replace resulting in attribute error