change script into daemon script