add validate function to design document
add frontend validation