refactoring logic, modal will now accept extended content correctly