Rebasing to version that works on 2.3.3