You should put this logic in another script.