using .closest() instead of .parent() to be more robust