Switched to using !empty() instead of isset()
Changed database field to NOT NULL
added check for non empty task and level variables