Added check for updates, removed many bugs in the template