add loss configuration