added background menu and fixed looping issue