fixed function to do its job
Merge pull request #1 from yazdani/master

fixed function to do its job