fix url fragment detection