added name availability check to the script