How to get the last candle when the candle closes?(Websocket)

hi every one

I want to make a screener.
But I have a problem getting information from the API, which is very time consuming.That’s why I use websocket.

I want to save the last 800 candlesticks of 50 currency pairs in my memory
The idea I have to reduce the number of requests is to store candlesticks in a list.
And as soon as the new candle closes, I add the last candle to the list and …

To solve this problem, I used btcusdt@kline_1m in the socket and by changing the candle time, I notice the candle closing. I use the last kline as the new candle. But this information is not accurate and often the price of close is different.

To get a closed candle, ensure that parameter “x” is true. Make sure that you are doing this correctly and check your results again.