Bug fixed with ErrorCatching