fixes #485 & 501
another layout bugfix