fixed python script where instead of getting last n emails, it would get first n emails