adds modal functionality