Fixed broken logic in morgan logging