fix curl generation and add close button to modal