Fixed refreeshing page bug