loss test added and tested