Fixed a bug, don't know if it is the right one