fixing issues in hooks