Fixed old code causing an error