formating and validation