add hide/show functionality and validation