Fixed Legacy code