fixed makescript function