adds if statement for modal