Implementing validation logic on UI side