fixed warnings and errors on page load