Fix javascript when new card/account window is already open