Fix #179

This fixes #179. Seems that you can only have 11 windows open at a time but function was looking at 12.