fixed some positioning bugs which caused flickering