Improved some SLA functions to stop the calculations when the module id is invalid