updated download pdf code