added hook for debug