added filename renaming functionality
added cmd checking