switched assert to correct order