fixed mercury issues, now working correctly