error checking and fixed centering issues in UI