fixed functions to find deleted scripts