add frontend logic for modal button