first working hook to db