working version with ssh