Added support for error check and parameters