added selecting colors from database
added break operation if page id is not found.