Removed debug alerts and fixed null check on content