Add validation method to write