Fixed bug in physicallayer