was ignoring error at wrong point