Changed a function to support Sublime Text 3