Added error condition when position is null