fixed broken modal opening + added events