scala mapping works with validation