Fixed minor bug in parallelization

Added check of memory status