Improved the earlier fix
Still need to fix flickering though