added outputs for error checking