Added support for page refreshing and clean URLs