bugfix and resizing