bug fix with null positions