Created hook file public path before writing file content. Fixed hook file n issue.