modified to work with 1.8.1