button working with validation