trim reload and added debugging