diff --git a/README.md b/README.md
index 5ee89ea05173bbdb012661deb8ab36c61e7de118..d30eeb76eea34c05a6a3916f29b28ed94d5f36fc 100755
--- a/README.md
+++ b/README.md
@@ -7,9 +7,9 @@ Moodle is a learning platform designed to provide educators, administrators and
 To install Moodle by Juju charm, you need to deploy PostgreSQL or MySQL and set relation between them.
 Follow this step by step instructions on using the charm:
 
-    juju deploy postgresql
+    juju deploy postgresql (or juju deploy mysql)
     juju deploy cs:~csd-garr/moodle
-    juju add-relation postgresql:db moodle
+    juju add-relation postgresql:db moodle (or juju add-relation mysql moodle)
     
 Expose the Moodle installation
 
@@ -59,6 +59,11 @@ It referes to Moodle git branch. By default this charm checkouts MOODLE_33_STABL
 
     juju config moodle branch=MOODLE_33_STABLE
     
+##Moodle data dir
+Path of the Moodle data directory
+
+    juju config moodle datadir="/moodledata"
+    
 ##Enable SMTP
 Moodle needs to send e-mail notifications to users. You can set up your outgoing e-mail configuration using an external SMTP server or enabling "enable-smtp" parameter in order to install a local Postfix SMTP server
 
diff --git a/hooks/config-changed b/hooks/config-changed
index 95c256174d6d31d935128e25f01acb3ecaa792ee..3854324f3483afbf1e3b66f89376d1b50f1088cc 100755
--- a/hooks/config-changed
+++ b/hooks/config-changed
@@ -150,7 +150,7 @@ fi
 
 #Install cron job for Moodle auto-update if "auto-update" is true
 if [ $(config-get auto-update) == "True" ]; then
-    cp hooks/inc/moodle_update /etc/cron.d/
+    cp $JUJU_CHARM_DIR/hooks/inc/moodle_update /etc/cron.d/
 else
     if [ -f /etc/cron.d/moodle_update ]; then rm /etc/cron.d/moodle_update; fi
 fi
@@ -164,7 +164,13 @@ else
 	apt-get remove -y postfix
 fi
 
-status-set active
+DBNAME=`grep dbname $WWWROOT/config.php | cut -d \' -f 2`
+
+if [ -z "$DBNAME"]; then
+	status-set blocked "Waiting for active database relation"
+else 
+	status-set active "Unit is Ready"
+fi
 
 
 
diff --git a/hooks/install b/hooks/install
index 22763c787b494af6424573999f8961642f80a23a..f2ca5bf43f29e9d3ab1c9c03a963135908b8e0e9 100755
--- a/hooks/install
+++ b/hooks/install
@@ -147,5 +147,4 @@ fi
 
 
 service apache2 restart
-status-set blocked "Waiting for active database connection"
 
diff --git a/hooks/mysql-db-relation-changed b/hooks/mysql-db-relation-changed
index 6dd5eeebd2844cad4178dd0854ce37bd92aa7bf7..f650b2f5bf83eb2fb02e7f13ab30e999be293d05 100644
--- a/hooks/mysql-db-relation-changed
+++ b/hooks/mysql-db-relation-changed
@@ -74,11 +74,11 @@ else
 	#Install Moodle PHP cron as cron job executed every minute
 	echo "*/1 * * * * root /usr/bin/php $WWWROOT/admin/cli/cron.php >/dev/null" > /etc/cron.d/moodle_cron
 	#Create cron job for Moodle auto-update
-	echo "* 2 * * * root $(pwd)/hooks/inc/update_moodle.sh" > hooks/inc/moodle_update
+	echo "* 2 * * * root $JUJU_CHARM_DIR/hooks/inc/update_moodle.sh" > $JUJU_CHARM_DIR/hooks/inc/moodle_update
 	
 	#Install cron job for Moodle auto-update if "auto-update" is true
 	if [ $(config-get auto-update) == "True" ]; then
-            cp hooks/inc/moodle_update /etc/cron.d/
+            cp $JUJU_CHARM_DIR/hooks/inc/moodle_update /etc/cron.d/
         else
             if [ -f /etc/cron.d/moodle_update ]; then rm /etc/cron.d/moodle_update; fi
         fi
@@ -112,6 +112,6 @@ service apache2 restart
 
 
 juju-log "Make the application port available, now that we know we have a site to expose"
-status-set active
+status-set active "Unit is Ready"
 open-port 80
 
diff --git a/hooks/pgsql-db-relation-changed b/hooks/pgsql-db-relation-changed
index 793a8e8f10d067072c6c043f78cc8e2623cfdbc4..2ddcf4758026245303b0fa4d18e49bfdcab0e930 100644
--- a/hooks/pgsql-db-relation-changed
+++ b/hooks/pgsql-db-relation-changed
@@ -74,11 +74,11 @@ else
 	#Install Moodle PHP cron as cron job executed every minute
 	echo "*/1 * * * * root /usr/bin/php $WWWROOT/admin/cli/cron.php >/dev/null" > /etc/cron.d/moodle_cron
 	#Create cron job for Moodle auto-update
-	echo "* 2 * * * root $(pwd)/hooks/inc/update_moodle.sh" > hooks/inc/moodle_update
+	echo "* 2 * * * root $JUJU_CHARM_DIR/hooks/inc/update_moodle.sh" > $JUJU_CHARM_DIR/hooks/inc/moodle_update
 	
 	#Install cron job for Moodle auto-update if "auto-update" is true
 	if [ $(config-get auto-update) == "True" ]; then
-            cp hooks/inc/moodle_update /etc/cron.d/
+            cp $JUJU_CHARM_DIR/hooks/inc/moodle_update /etc/cron.d/
         else
             if [ -f /etc/cron.d/moodle_update ]; then rm /etc/cron.d/moodle_update; fi
         fi
@@ -94,6 +94,6 @@ service apache2 restart
 
 
 juju-log "Make the application port available, now that we know we have a site to expose"
-status-set active
+status-set active "Unit is Ready"
 open-port 80