rework to make it work