Added additional checks and url option