pull request from Ranga Bandara (odesk)