adding standard error management
fixing position of args