solving NPE and fix the position of the view