Bug fix

A very important bug in giving way fixed