trying to fix existing code