improved card handling