write hook tests added