fixed some UI bugs and optimized a couple of things