fixing the bed problem