made some functions autoload and fixed a typing error