fixed code to work with validation recommendations