added edit functionality for cards