added a simple ~/ check on filename