Adding guard to prevent binding error