bug fix for error checking code