fixed some event bindings and added error for non-existing pages