updated for handling the new changes in hooks -- in progress