move error into module