Edited validate method