Attempt at fixing high cpu usage bug