fixed mistaken usage of error