Fixed wrong open modal window logic