error calculation modified