fixed undefined error for mercury file