Fix fragment state loss