some fix from the original one