Changes layout and fixed connection to databse