fixed the card slide out and in function