need to check error on first layer