Remove flash message and validate url