modified to work better with 1.9