updated modal functionality