Fixed page refreshing error