Solve bug, when empty surface drawed then program crashed