add url validation and bug fixes