added 'file' parameter to executeCommand function