validation and popup working