Fixing bug #2

Added code to replace invalid fileName characters.
Merge pull request #3 from palashkaria/master

Fixing bug #2