fixed Notice Error: Undefined index

This small changes should fixed Notice Error: Undefined index when using Sqlite as database.