Fixed NPE when creating a new card