hooks getting called twice