small fix for opening code from database