Added handlers to window