fixed sql pb with gem