Fixing fosrest bug