Moved storage path existence check before realpath()