Slight modification

Added an exception handling to the connectDB() function