Simple solution to problem. Would require refactoring