Fixed legacy code