fixing bugs with standard error