fix code to work on 5.3