shortened bugfix

Now uses less code to fix ui bugs