Added ssh key
Added file flag check
added check for file flag