fix and streamline modal validation