Moved checking url to before checkit() call