change file check to -e for portability reasons