script changes, ending fix