Add better loss checking