fix the background image not appearing in some cases