Fix maintenability index bug

Added try to local functions