restored code to earlier version