Fixed card create function and logging