Edited to solve startup-crash after first start.