Fixed sql error on payment status update