improved installation function