reverted buggy code